<?php
/**
 * Created by viva.
 * User: xj
 * Tel:  13675170078
 * Date: 2015/6/8
 * Time: 17:13
 */
namespace Admin\Controller;

use Think\Controller;

class CommonController extends  Controller
{
    private $action_name=array();
    private $controller_name=array('User');
    public function _initialize()
    {

        if(!in_array(CONTROLLER_NAME ,$this->controller_name) && !in_array(ACTION_NAME,$this->action_name) )
        {
            if(!session('user_data'))
            {
                $this->error('您还没有登录，请登录',U('User/login'));
            }
        }
    }
}
